import { loadEnv } from 'vite';
const server = (mode: string) => {
    const env = loadEnv(mode, process.cwd(), 'VITE_');
    return ({
            open: true,
            host: '0.0.0.0',
            port: 3005,
            hmr: {
                overlay: false,
            },
            proxy: {
                // env 中指定地址，则优先从env中获取
                '/api/': env.VITE_PROXY_URL ?? 'https://xx.dev.com/',
            },
            watch: {
                // ignored: ['!**/node_modules/@kx/database/dist/**'],
            },
        }
       )
};

export default server;
 
            